﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace IrisGenerator.Framework.Messaging
{
    public static class Icon
    {
        public static MessageIcon ConvertFrom(MessageBoxIcon value)
        {
            switch (value)
            {
                case MessageBoxIcon.Error:
                    return MessageIcon.Error;
                    
                case MessageBoxIcon.Information:
                    return MessageIcon.Information;
                    
                case MessageBoxIcon.None:
                    return MessageIcon.None;
                    
                case MessageBoxIcon.Question:
                    return MessageIcon.Question;
                    
                
                case MessageBoxIcon.Warning:
                    return MessageIcon.Warning;
                    
                default:
                    return MessageIcon.None;
                    
            }
        }

        public static MessageIcon ConvertFrom(int value)
        {
            switch (value)
            {
                case 0:
                    return MessageIcon.None;
                case 1:
                    return MessageIcon.Error;
                case 2:
                    return MessageIcon.Question;
                case 3:
                    return MessageIcon.Warning;
                case 4:
                    return MessageIcon.Information;
                default:
                    return MessageIcon.None;
            }
        }

        public static MessageIcon ConvertFrom(string value)
        {
            return (MessageIcon)Enum.Parse(typeof(MessageIcon), value);
        }

        public static MessageBoxIcon ConvertToMessageBoxIcon(MessageIcon icon)
        {
            switch (icon)
            {
                case MessageIcon.Error:
                    return MessageBoxIcon.Error;
                case MessageIcon.Information:
                    return MessageBoxIcon.Information;
                case MessageIcon.None:
                    return MessageBoxIcon.None;
                case MessageIcon.Question:
                    return MessageBoxIcon.Question;
                case MessageIcon.Warning:
                    return MessageBoxIcon.Warning;
                default:
                    return MessageBoxIcon.None;
            }
        }
    }
}
